package com.ljh.controller;

import com.ljh.service.UserService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.net.InetAddress;

/**
 * @Author grung
 * @Date 2020/10/8 17:48
 * @Version 1.0
 */

@Controller
public class UserController {


    @Reference(loadbalance = "roundrobin")
    private UserService userService;

    @RequestMapping(value = "/getUser",method = {RequestMethod.POST,RequestMethod.GET})
    @ResponseBody
    public String getUser(String name, HttpServletRequest request){

        return userService.getUser(name);
    }



}
